package cn.momoky.ccool.utils;

import lombok.Getter;
import lombok.ToString;

@Getter
@ToString
public enum ResultStatus {

    // 公共响应状态
    SUCCESS( 200, "请求成功"),
    NOT_LOGIN(401, "请先登录"),
    NOT_FOUND(404, "请求资源未找到"),
    INTERNAL_SERVER_ERROR(500, "内部服务错误"),

    // uaa 服务响应状态
    NOT_FOUND_USER(600, "用户未找到"),
    PASSWORD_ERROR(601, "密码错误"),
    TOKEN_NULL(602,"token为空"),
    TOKEN_INVALID(603,"token失效"),
    TOKEN_BUILD_FAIL(604,"token生成失败"),

    NORMAL_USER(0,"正常用户"),
    ABNORMAL_USER(1,"异常用户"),
    ;

    /** 业务异常码 */
    private final Integer code;
    /** 业务异常信息描述 */
    private final String msg;

    ResultStatus(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}
